package com.itheima.job;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.service.OrderSettingService;
import com.itheima.utils.DateUtils;
import org.junit.Test;

import java.util.Date;

/**
 * @Author: Deng
 * @date: 2020-04-15 17:33
 * @description:
 */
public class ClearOrderSetting {

    @Reference
    private OrderSettingService orderSettingService;

    //把过期的预约设置信息备份到备份表中,并从预约设置表中删除
    //我在MySql中新建了一个表: t_ordersetting_backsup
        //用以存储过期的预约设置数据,表的结构与t_ordersetting一样
    public void clearOrderSetting() throws Exception {
        System.out.println("清理预约设置开始..");
        Date date = new Date();
        orderSettingService.clearOrderSetting(date);
    }

}
